package com.houmeiyuan.huiguniang.ctrl;

import com.houmeiyuan.huiguniang.common.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@EnableDiscoveryClient
@RefreshScope
@RequestMapping("/hi")
public class HiCtrl extends BaseCtrl {

    private static final Logger LOG = LoggerFactory.getLogger(HiCtrl.class);

    @Value("${test}")
    String test;

    @RequestMapping("/chan")
    public Result hi() {
        LOG.info("/hi/chan");
        Result result = new Result();
        result.setResult(test);
        return result;
    }

    @RequestMapping("/hao")
    public Result hihao() {
        Result result = new Result();
        result.setResult("hao");
        return result;
    }
}
